<?php

function RegisterMyClassName($className, $classPath)
{
	global $arrPublicClassName;
	$arrPublicClassName[$className] = $classPath;
}

function PublicLibAutoLoader($className)
{
	global $arrPublicClassName;
	if(array_key_exists($className, $arrPublicClassName))
	{
		require_once($arrPublicClassName[$className]);
	}
}

define('API_DOMAIN',	'authsystem');//api名称

define('HTDOCS_PATH',	'');//我的环境

define('CRYPT_KEY', 'authsystem');//加密密码，自己修改

define('CURRENT_REGION', 'bj');

define('CONFIG_PATH', HTDOCS_PATH .'/config');
define('PUBLIC_PATH',	HTDOCS_PATH .'/public');
define('API_PATH',		HTDOCS_PATH .'/api');


$GLOBALS['arrPublicClassName'] = array (
		'DBConfig'		=> 		CONFIG_PATH .'/DBConfig.conf.php',
		'RedisConfig'	=> 		CONFIG_PATH .'/RedisConfig.conf.php',

		'CLog'			=> 		PUBLIC_PATH .'/CLog.class.php',
		'MyCrypt'		=> 		PUBLIC_PATH .'/MyCrypt.class.php',
		'Utils'			=> 		PUBLIC_PATH .'/Utils.class.php',
		'ErrorDefine'	=> 		PUBLIC_PATH .'/ErrorDefine.class.php',
		'Common'		=> 		PUBLIC_PATH .'/Common.class.php',
		'PDOWrapper'	=> 		PUBLIC_PATH .'/PDOWrapper.class.php',

        'User'          =>      API_PATH.'/User.class.php',
		'AdminManage'	=>		API_PATH.'/AdminManage.class.php',//管理员接口
		'AdminModify'	=>		API_PATH.'/AdminModify.class.php',//管理员所有修改功能
		'AdminAdd'		=>		API_PATH.'/AdminAdd.class.php',//管理员所有添加功能
		'AdminSearch'	=>		API_PATH.'/AdminSearch.class.php',//管理员所有查询功能
		'AdminDelete'	=>		API_PATH.'/AdminDelete.class.php',//管理员所有查询功能
		'Admins'        =>      API_PATH.'/Admins.class.php',//管理员管理

);

spl_autoload_register('PublicLibAutoLoader');

?>
